import { Image } from "ol/layer"
import { ImageWMS } from "ol/source"
import { baseUrl, storeName } from "./param"
function loadWMSLayer(map, layerName) {
    const wms = new Image({
        source: new ImageWMS({
            url: baseUrl + "/wms",
            params: { LAYERS: `${storeName}:${layerName}` },
            ratio: 1,
            serverType: "geoserver"
        })
    })
    map.addLayer(wms)
    return wms
}

export default loadWMSLayer